<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
     <button id="btn_1">打印当前页面</button>
	 <p>这是一个 window 对象中的打印功能，很有用哦</p>
	 <p>大家只需要调用 window.print()方法就能实现打印功能</p> 
 </body>
    <script>
	   window.onload = function(){
	     var btn_1 = document.getElementById("btn_1");
		 //打印当前页面
		 btn_1.onclick = function(){
		   window.print();
		 }
	   }
	</script>
</html>
